package com.zhiy.com.estation.ui.fragment.login;

import com.zhiy.com.estation.model.User;
import com.zhiy.com.estation.api.Api;
import com.zhiy.com.estation.api.ApiResult;

import io.reactivex.Flowable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;

/**
 * 登录的网络请求在这个类中进行
 * Created by Zyh on 2016/12/3.
 */
public class LoginModel implements LoginContract.Model {
    @Override
    public Flowable<ApiResult<User>> login(String name, String password) {
        return Api.getInstance().mService
                .login(name,password)
                .subscribeOn(Schedulers.newThread())
                .observeOn(AndroidSchedulers.mainThread());
    }
}
